﻿<UserControl x:Class="Chapters.Chapter14.FocusVisualStyleExample"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="FocusBorderBrush.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="ButtonFocusVisualStyle"
                   TargetType="Control">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Control">
                            <Border Background="{StaticResource FocusBorderBrush}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>

    <UniformGrid Columns="2"
                 Height="300"
                 Margin="20">
        <Button Margin="10">Regular Button</Button>
        <Button Margin="10"
                FocusVisualStyle="{StaticResource ButtonFocusVisualStyle}">Button with FocusVisualStyle</Button>
    </UniformGrid>
</UserControl>
